﻿@model ProjectManager.Models.UserCourses
<h2>
    Courses Enrollment for @ViewBag.userName</h2>
<table>
    <tr>
        <th>
            Course
        </th>
        <th>
            Options
        </th>
    </tr>
    @foreach (var item in Model.Have)
    {
        <tr>
            <td>
                @Html.ActionLink(item.Name, "Projects", new { id = item.ID })
            </td>
            <td>
                @Html.ActionLink("Delete", "UserCourseDelete", new { id = item.ID, userName = ViewBag.userName })
            </td>
        </tr>
    }
</table>
<br />
<br />

@if (Model.Rest.Count > 0)
{
    <h2>
        Add Courses</h2>

    using (Html.BeginForm())
    {   
    <div class="editor-label">
        Course: @Html.DropDownList("Add", new SelectList(Model.Rest, "Id", "Name"))
        <input type="submit" value="Add" />
    </div>   
    }
    <br />
}
<div>
    @Html.ActionLink("Back to List", "Index", "Account", null, null)
</div>

